<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>函数-冒泡</title>
		<script>
		function mySort(arr) {
						for (var i = 1; i <= arr.length - 1; i++) {
							for (var j = 0; j <= arr.length - i; j++) {
								if (arr[j] > arr[j + 1]) {
									var temp;
									temp = arr[j];
									arr[j] = arr[j + 1];
									arr[j + 1] = temp;
								}
							}
						}
						return arr;
					}
					console.log(mySort([11,3,2,5,9,4]));
					</script>
	</head>
	<body>
	</body>
</html>
